package edu.pitt.dbmi.odie.gapp.gwt.client.navigator;

public class ODIE_NavigatableAnnotation extends ODIE_NavigatableMetaData {

	private static final long serialVersionUID = -4868253873587250823L;
	private String annotationId ;
	private String color ;
	private String sPos;
	private String ePos;
	private int startOffset ;
	private int endOffset ;
	private int lineOffset ;
	private String ontologyName ;
	private String clsName ;
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
	}
	
	public String getAnnotationId() {
		return annotationId;
	}

	public void setAnnotationId(String annotationId) {
		this.annotationId = annotationId;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	public int getStartOffset() {
		return startOffset;
	}

	public void setStartOffset(int startOffset) {
		this.startOffset = startOffset;
	}

	public int getEndOffset() {
		return endOffset;
	}

	public void setEndOffset(int endOffset) {
		this.endOffset = endOffset;
	}
	
	public String toString() {
		String result = "" ;
		result += "Annotation: (" + this.clsName + ", " + this.ontologyName + ", " + this.startOffset + ", " + this.endOffset + ") " + super.toString() ;
		return result ;
	}

	public int getLineOffset() {
		return lineOffset;
	}

	public void setLineOffset(int lineOffset) {
		this.lineOffset = lineOffset;
	}
	
	public String getSPos() {
		return sPos;
	}

	public void setSPos(String pos) {
		sPos = pos;
		setStartOffset(Integer.valueOf(sPos)-1) ;
	}

	public String getEPos() {
		return ePos;
	}

	public void setEPos(String pos) {
		ePos = pos;
		setEndOffset(Integer.valueOf(ePos)-1) ;
	}
	
	public String deriveHtmlIdPart() {
		StringBuffer sb = new StringBuffer() ;
		sb.append("Annotation-") ;
		sb.append(getSPos());
		sb.append("-") ;
		sb.append(getEPos());
		sb.append("-") ;
		sb.append(getAnnotationId()) ;
		return sb.toString();
	}


}
